package com.loeng.module.system.api.user;

import com.loeng.framework.common.util.object.BeanUtils;
import com.loeng.module.system.api.user.dto.AdminUserRespDTO;
import com.loeng.module.system.dal.dataobject.user.AdminUserDO;
import com.loeng.module.system.service.user.AdminUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 管理后台的 AdminUserApi 接口实现类
 * @author loeng zhuo
 */
@Service
public class AdminUserApiImpl implements AdminUserApi {

    @Resource
    private AdminUserService userService;

    /**
     * 获得指定编号的用户
     *
     * @param userId 用户编号
     * @return 用户
     */
    @Override
    public AdminUserRespDTO getUser(Long userId) {
        AdminUserDO user = userService.getUser(userId);
        return BeanUtils.toBean(user, AdminUserRespDTO.class);
    }
}
